<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserMedia extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // `user_id` int(11) NOT NULL COMMENT '用户ID',
        //  `type` tinyint(1) NOT NULL COMMENT '媒体类型，1：相片，2：视频',
        //  `media` varchar(255) NOT NULL COMMENT '媒体路径',
        Schema::dropIfExists('user_media');
        Schema::create('user_media', function (Blueprint $table){
            $table->comment = "用户媒体";
            $table->increments('id')->comment("ID");

            $table->integer('user_id')->comment("用户ID");
            $table->string("media_link")->comment("素材路径");
            //$table->tinyInteger("type")->comment("媒体类型");
            //$table->string("media")->comment("媒体路径");


            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
